<template>
    <view class="page-scope data-v-4b3a103f" style="background: #101113">
        <default-theme
            @__l="__l"
            class="data-v-4b3a103f"
            :getNextPageCounter="getNextPageCounter"
            :homeNum="homeNum"
            :page="page"
            :refreshCounter="refreshCounter"
            vueId="771a8ae2-1"
            v-if="renderTheme === 'default'"
        ></default-theme>
        <block v-else>
            <homepage-theme
                @__l="__l"
                class="data-v-4b3a103f"
                :getNextPageCounter="getNextPageCounter"
                :homeNum="homeNum"
                :isFixed="isFixed"
                :page="page"
                :refreshCounter="refreshCounter"
                vueId="771a8ae2-2"
                v-if="renderTheme === 'homepage'"
            ></homepage-theme>
        </block>
        <float-btn
            @__l="__l($event, { eventOpts: [['^tap', [['invite']]]] })"
            @tap.native="__e($event, { eventOpts: [['^tap', [['invite']]]] })"
            class="data-v-4b3a103f"
            :data-event-opts="[['^tap', [['invite']]]]"
            :isAnimated="floatBtn.is_animate"
            :link="floatBtn.link"
            :src="floatBtn.image"
            vueId="771a8ae2-3"
            v-if="isShowFloatBtn"
        ></float-btn>
        <share-popup
            @__l="__l($event, { eventOpts: [['^close', [['hideSharePopup']]]] })"
            @close="__e($event, { eventOpts: [['^close', [['hideSharePopup']]]] })"
            class="data-v-4b3a103f"
            :data-event-opts="[['^close', [['hideSharePopup']]]]"
            :info="posterInfo"
            vueId="771a8ae2-4"
            v-if="isSharePopup"
        ></share-popup>
    </view>
</template>

<script>
import floatBtn from '@/components/FloatBtn/FloatBtn';
import sharePopup from '@/components/SharePopup/SharePopup';
import defaultTheme from '@/components/PageRender/themes/DefaultTheme';
import homepageTheme from '@/components/PageRender/themes/HomepageTheme';
import tabBar from '@/components/TabBar/tabBar';
(global.webpackJsonp = global.webpackJsonp || []).push([
    ['components/PageRender/PageRender'],
    {
        3592: function (e, t, n) {
            'use strict';

            n.r(t);
            var o = n('e9ea');
            var r = n.n(o);
            for (var a in o) {
                if (['default'].indexOf(a) < 0) {
                    (function (e) {
                        n.d(t, e, function () {
                            return o[e];
                        });
                    })(a);
                }
            }
            t.default = r.a;
        },
        '7db2': function (e, t, n) {
            'use strict';

            var o = n('c53e');
            n.n(o).a;
        },
        '8abf': function (e, t, n) {
            'use strict';

            n.d(t, 'b', function () {
                return r;
            });
            n.d(t, 'c', function () {
                return a;
            });
            n.d(t, 'a', function () {
                return o;
            });
            var o = {
                FloatBtn: function () {
                    return n.e('components/FloatBtn/FloatBtn').then(n.bind(null, 'e690'));
                },
                SharePopup: function () {
                    return Promise.all([n.e('common/vendor'), n.e('components/SharePopup/SharePopup')]).then(n.bind(null, 'b677'));
                }
            };
            var r = function () {
                this.$createElement;
                this._self._c;
            };
            var a = [];
        },
        b4aa: function (e, t, n) {
            'use strict';

            n.r(t);
            var o = n('8abf');
            var r = n('3592');
            for (var a in r) {
                if (['default'].indexOf(a) < 0) {
                    (function (e) {
                        n.d(t, e, function () {
                            return r[e];
                        });
                    })(a);
                }
            }
            n('7db2');
            var i = n('f0c5');
            var u = Object(i.a)(r.default, o.b, o.c, false, null, '4b3a103f', null, false, o.a, void 0);
            t.default = u.exports;
        },
        c53e: function (e, t, n) {},
        e9ea: function (e, t, n) {
            'use strict';

            (function (e) {
                var o = n('4ea4');
                Object.defineProperty(t, '__esModule', {
                    value: true
                });
                t.default = void 0;
                var r = o(n('9523'));
                var a = n('26cb');
                function i(e, t) {
                    var n = Object.keys(e);
                    if (Object.getOwnPropertySymbols) {
                        var o = Object.getOwnPropertySymbols(e);
                        if (t) {
                            o = o.filter(function (t) {
                                return Object.getOwnPropertyDescriptor(e, t).enumerable;
                            });
                        }
                        n.push.apply(n, o);
                    }
                    return n;
                }
                function u(e) {
                    for (var t = 1; t < arguments.length; t++) {
                        if (null != arguments[t]) {
                            var n = arguments[t];
                        } else {
                            var n = {};
                        }
                        if (t % 2) {
                            i(Object(n), true).forEach(function (t) {
                                (0, r.default)(e, t, n[t]);
                            });
                        } else {
                            Object.getOwnPropertyDescriptors
                                ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n))
                                : i(Object(n)).forEach(function (t) {
                                      Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
                                  });
                        }
                    }
                    return e;
                }
                var c = {
                    components: {
                        DefaultTheme: function () {
                            n.e('components/PageRender/themes/DefaultTheme')
                                .then(
                                    function () {
                                        return resolve(n('ee86'));
                                    }.bind(null, n)
                                )
                                .catch(n.oe);
                        },
                        HomepageTheme: function () {
                            Promise.all([n.e('common/vendor'), n.e('components/PageRender/themes/HomepageTheme')])
                                .then(
                                    function () {
                                        return resolve(n('3b65'));
                                    }.bind(null, n)
                                )
                                .catch(n.oe);
                        }
                    },
                    props: {
                        page: {
                            type: Object,
                            default: function () {
                                return {
                                    title: '',
                                    modules: [],
                                    isSharePopup: false
                                };
                            }
                        },
                        homeNum: Number,
                        theme: {
                            type: String
                        },
                        fullPageMode: {
                            type: Boolean,
                            default: function () {
                                return true;
                            }
                        },
                        isFixed: {
                            type: Boolean,
                            default: function () {
                                return false;
                            }
                        },
                        refreshCounter: Number,
                        getNextPageCounter: Number
                    },
                    data: function () {
                        return {
                            isSharePopup: false
                        };
                    },
                    computed: u(
                        u({}, (0, a.mapGetters)(['userInfo'])),
                        {},
                        {
                            renderTheme: function () {
                                return (this.page && this.page.base && this.page.base.theme) || this.theme || 'default';
                            },
                            title: function () {
                                return (this.page && this.page.title) || '未设置';
                            },
                            navColor: function () {
                                return (this.page && this.page.nav_color) || '#FFFFFF';
                            },
                            isShowFloatBtn: function () {
                                return this.page && this.page.is_float_btn;
                            },
                            floatBtn: function () {
                                return (this.page && this.page.float_btn) || {};
                            },
                            posterInfo: function () {
                                return {
                                    money_price: '',
                                    score_price: '',
                                    title: this.title,
                                    path: this.getShareConfig().path,
                                    thumb: 'https://img121.7dun.com/yuanqimali/share/posterImg.png'
                                };
                            }
                        }
                    ),
                    mounted: function () {
                        this.setNav();
                    },
                    watch: {
                        title: function () {
                            this.setNav();
                        },
                        navColor: function () {
                            this.setNav();
                        }
                    },
                    methods: {
                        setNav: function () {
                            if (!this.fullPageMode) {
                                return false;
                            }
                            e.setNavigationBarTitle({
                                title: this.title
                            });
                            e.setNavigationBarColor({
                                backgroundColor: this.navColor,
                                frontColor: '#ffffff'
                            });
                        },
                        invite: function () {
                            if ('invite' == this.floatBtn.link.url) {
                                this.isSharePopup = true;
                            }
                        },
                        hideSharePopup: function () {
                            this.isSharePopup = false;
                        }
                    }
                };
                t.default = c;
            }.call(this, n('543d').default));
        }
    }
]);
(global.webpackJsonp = global.webpackJsonp || []).push([
    'components/PageRender/PageRender-create-component',
    {
        'components/PageRender/PageRender-create-component': function (e, t, n) {
            n('543d').createComponent(n('b4aa'));
        }
    },
    [['components/PageRender/PageRender-create-component']]
]);
</script>
<style>
@import './PageRender.css';
</style>
